﻿-- DataType a insérer
DECLARE @DataTypeId UNIQUEIDENTIFIER
SET @DataTypeId = '115d0aeb-b145-4f4c-b5c5-56d6c4216f42'

SELECT 
'IF NOT EXISTS(SELECT NULL FROM dbo.Medianamik_DataType WHERE [DataTypeId] =   ''' + CAST(@DataTypeId as NVARCHAR(38)) + ''')
INSERT INTO [dbo].[medianamik_DataType]
           ([DataTypeID]
           ,[DataTypeSQLName]
           ,[MustSpecifyLength]
           ,[Hidden]
           ,[Indexable])
     VALUES
           ('''+CAST(DataTypeID as nvarchar(38))+'''
           ,'''+[DataTypeSQLName]+'''
           ,'+cast([MustSpecifyLength] as varchar)+'
           ,'+cast([Hidden] as varchar)+'
		   ,'+cast([Indexable] as varchar)+')'
FROM [medianamik_DataType]
Where [DataTypeId] = @DataTypeId